package zcjq.d907;

import java.util.ArrayList;
import java.util.List;

public class Singleton {
    private static final Singleton INSTANCE = new Singleton();

    private Singleton() {
    }

    public static Singleton getInstance() {
        return INSTANCE;
    }

    public static void main(String[] args) {
        Singleton s1 = Singleton.INSTANCE;
        Singleton s2 = Singleton.getInstance();
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(4);
        int a = list.stream().map(b -> 1).reduce(0, (c, b) -> c + b);
        System.out.println(a);
    }
}
